package com.hualian.coupon.service.impl;

import com.hualian.coupon.mapper.CouPonMapper;
import com.hualian.coupon.pojo.Coupon;
import com.hualian.coupon.service.CouponService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @author Lxd
 * @Description TODO
 * @date 2020/10/22 13:11
 * @Version 1.0
 */
@Service("couponService")
public class CouponServiceImpl implements CouponService {

    @Resource
    CouPonMapper couPonMapper;

    @Override
    public int add(Coupon record) {
        return couPonMapper.insertSelective(record);
    }

    @Override
    public List<Coupon> list() {
        return couPonMapper.selectAll();
    }

    @Override
    public List<Map<String,Object>> queryCop(String phone) {
        return couPonMapper.getAllByPhone(phone);
    }
}
